<?php
/**
 * Created by JetBrains PhpStorm.
 * User: avnovoselov
 * Date: 25.10.12
 * Time: 1:11
 * To change this template use File | Settings | File Templates.
 */
class view
{
    public static function init(array $data = array())
    {
        if (!empty($data['view']) && file_exists(conf::$mvc.conf::$vpath.$data['view'].'.php'))
        {
            foreach ($data as $k => $v)
            {
                if ($k != 'view')
                {
                    $$k = $v;
                }
            }
            include conf::$mvc.conf::$vpath.$data['view'].'.php';
            return;
        }
        echo 'wrong view';
    }
}
